<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/displaytag-11.tld" prefix="display"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>untitled</title>
<link href="../../css/jdeveloper.css" rel="stylesheet" media="screen" />
<link href="<%=request.getContextPath() + "/css/bloques.css"%>"
	rel="stylesheet" type="text/css">
<link href="<%=request.getContextPath() + "/css/table.css"%>"
	rel="stylesheet" type="text/css">
<script type="text/javascript">
    function validar(){
      if(document.NuevoGrupoFamiliar.nombre.value == "" || document.NuevoGrupoFamiliar.codeParentesco.value=="" ){
        alert("Deben ser llenados todos los campos");
        return false;
      }else{
        document.NuevoGrupoFamiliar.submit();
      }
    }
  </script>
</head>
<body>
	<div align="center">
		<table style="width: 80%; border: 0; padding: 0; border-spacing: 0;">
			<tr align="left">
				<td height="25" colspan="12" align="center" class="titulosenblanco">
					<p>
						<STRONG>Nuevo Grupo Familiar</STRONG>
					</p>
					<p>&nbsp;</p>
				</td>
			</tr>

			<html:form action="/beneficiarios/GuardarGrupoFamiliar.do"
				method="get" focus="nombre"
				type="co.gov.medellin.ssti.sub.web.form.NuevoGrupoFamiliarForm">
				<tr align="left">
					<td height="25" colspan="12" class="titulosenblanco">
						<table
							style="width: 100%; border: 0; padding: 3px; border-spacing: 3px;">

							<%
								String strMessageErrorNGF = (String) session
											.getAttribute("msgErrorNGF");
									if (strMessageErrorNGF != null) {
										session.removeAttribute("strMessageErrorNGF");
							%>
							<tr>
								<td align="center" colspan="3"><font class="celdatabla"><STRONG><%=strMessageErrorNGF%></STRONG></font>
								</td>
							</tr>
							<tr>
								<td>
									<P>&nbsp;</P>
								</td>
							</tr>
							<%
								}
							%>

							<logic:iterate id="bene" length="1" name="bene">
								<tr>
									<td width="3%">&nbsp;</td>
									<td width="39%" class="celdatabla"><strong>Beneficiario
											cabeza del grupo:</strong></td>
									<td width="56%">

										<div class="form">
											<bean:write name="bene" property="nombre1" />
											<bean:write name="bene" property="nombre2" />
											<bean:write name="bene" property="primerApellido" />
											<bean:write name="bene" property="segundoApellido" />
										</div> <input type="hidden" name="code"
										value="<bean:write name="bene" property="code" />" />

									</td>
									<td width="3%">&nbsp;</td>
								</tr>
								<tr>
									<td width="3%">&nbsp;</td>
									<td width="39%" class="celdatabla"><strong>Nombre
											del grupo familiar:</strong></td>
									<td width="56%"><input type="text" class="form"
										name="nombre"
										value="GF-<bean:write name="bene" property="numeroDocumento" />" />
									</td>
									<td width="3%">&nbsp;</td>
								</tr>
								<tr>
									<td width="3%">&nbsp;</td>
									<td width="39%" class="celdatabla"><strong>Rol
											dentro del grupo</strong>:</td>
									<td width="56%">
										<%
											String strCode = (String) session
															.getAttribute("codeParentesco");
										%> <html:select property="codeParentesco"
											value="<%=strCode%>" styleClass="form">
											<html:option value="">Seleccione un rol</html:option>
											<html:options name="parentescos" labelName="code"
												labelProperty="descVflex" property="code"
												collection="parentescos" />
										</html:select>
									</td>
									<td width="3%">&nbsp;</td>
								</tr>
								<tr>
									<td width="3%" colspan="4">&nbsp;</td>
								</tr>
								<tr>
									<td width="3%" colspan="4">
										<DIV align="center">
											&nbsp;&nbsp;&nbsp; <input type="hidden" name="origen"
												value="nuevo" /> <input type="button" value="Guardar"
												onclick="validar();" />
										</DIV>
									</td>
								</tr>
							</logic:iterate>
						</table>
					</td>
				</tr>
			</html:form>

		</table>
	</div>

</body>
</html>
